﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VelocityBoost : MonoBehaviour
{
    public float min;
    public float max;

    public float _vScale;
    private void OnCollisionEnter2D(Collision2D collision)
    {
        float scale = (float)decimal.Round((decimal)Random.Range(min, max), 2);
        _vScale = scale;
        Vector2 oldV = collision.rigidbody.velocity;
        oldV = new Vector2((float)decimal.Round((decimal)oldV.x, 3), (float)decimal.Round((decimal)oldV.y, 3));
        collision.rigidbody.velocity = oldV * scale;
        //Debug.Log(collision.rigidbody.velocity);
    }
}
